---
title: Basic Agent
---

## Code

```python cookbook/models/nexus/basic.py
from agno.agent import Agent, RunOutput  # noqa
from agno.models.nexus import Nexus

agent = Agent(model=Nexus(id="anthropic/claude-sonnet-4-20250514"), markdown=True)

# Get the response in a variable
# run: RunOutput = agent.run("Share a 2 sentence horror story")
# print(run.content)

# Print the response in the terminal
agent.print_response("Share a 2 sentence horror story")

```

## Usage

<Steps>
  <Snippet file="create-venv-step.mdx" />

<Step title="Set your API keys">
```bash 
export OPENAI_API_KEY=xxx
export ANTHROPIC_API_KEY=xxx 
```
</Step>

<Step title="Install libraries">
```bash 
pip install -U agno openai 
```
</Step>

  <Step title="Run Agent">
    <CodeGroup>
    ```bash Mac
    python cookbook/models/nexus/basic.py
    ```

    ```bash Windows
    python cookbook/models/nexus/basic.py
    ```
    </CodeGroup>

  </Step>
</Steps>